package com.example.service;

import com.example.entity.Student;
import com.example.entity.Students;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 卓小建
 * Date: 2018-12-18
 * Time: 13:35
 * rest接口
 */
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public interface StudentInterface {
    @GET
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    @Path("/getone/{id:[0-9]{0,10}}") //限制id只能是0-9的数组，不超过10位
     Student getStudent(@PathParam("id") Integer id);

    @GET
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    @Path("/getmany/{ids}")
    Students getAllStudent(@PathParam("ids") String ids);
}
